package com.hyq.learn.rabbitmq.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpAdmin;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author heyuqin
 * @date 2024/8/20 17:16
 */
@Configuration
public class RabbitMqConfig {

    private final static Logger LOGGER = LoggerFactory.getLogger(RabbitMqConfig.class);

    @Bean
    public AmqpAdmin amqpAdmin(ConnectionFactory connectionFactory) {
        LOGGER.info("Initializing master amqpAdmin...");
        return new RabbitAdmin(connectionFactory);
    }

}
